package www.ld.com.domain.department.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import www.ld.com.core.group.InsertGroup;
import www.ld.com.core.group.UpdateGroup;
import www.ld.com.dictionary.UseStatusEnum;

import javax.validation.constraints.NotBlank;

@Data
@Accessors(chain = true)
@ToString
@EqualsAndHashCode
@ApiModel(value = "InDepartmentVO" ,description = "部门详情")
public class InDepartmentVO {
    @ApiModelProperty(value = "ID")
    @NotBlank(message = "部门ID不能为空",groups = UpdateGroup.class)
    private String id;
    @ApiModelProperty(value = "部门名称")
    @Length(max = 20,min = 2,message = "部门名称必须是{min}~{max}个字符",groups = {UpdateGroup.class, InsertGroup.class} )
    private String name;
    @ApiModelProperty(value = "部门排序")
    @Range( max = 100,message = "部门排序不能大于{max}" ,groups = {UpdateGroup.class, InsertGroup.class})
    private int sort;
    @ApiModelProperty(value = "部门状态")
    private UseStatusEnum status;
    @ApiModelProperty(value = "上级部门")
    private String parentId;
    @ApiModelProperty(value = "部门负责人")
    @Length(max = 15,message = "部门名称不能大于{max}个字符" ,groups = {UpdateGroup.class, InsertGroup.class})
    private String liaison;
    @ApiModelProperty(value = "负责人电话")
    @Length(max = 15,message = "负责人电话不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class} )
    private String phone;
    @ApiModelProperty(value = "负责人邮件")
    @Length(max = 20,message = "负责人邮件不能大于{max}字符",groups = {UpdateGroup.class, InsertGroup.class} )
    private String email;
}
